package com.ckjw.gobang.view;

import javax.swing.JPanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import java.awt.BorderLayout;
import java.awt.Button;

import javax.swing.JLabel;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import javax.swing.border.LineBorder;

import com.ckjw.gobang.connect.UserClientService;

import javax.swing.JTextField;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingConstants;
import java.awt.Font;
import java.awt.ScrollPane;

import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import javax.swing.JTextPane;
//547 180
public class UserPanel2 extends JPanel {
	private JTextField textField;
	public static UserPanel2 userPanel;
	public static usertx selectUsertx=null;
	//public static String gameuser;
	public static  JPanel panel_1;
	public static  JTextField textField_1;//用户名
	public static  JTextField txtId;//id
	public static JTextField textField_2;//棋色
	public static JTextField textField_3;//对战用户名
	public static JTextField textField_4;//id
	public static JTextField textField_5;//棋色
	private JLabel lblNewLabel_2;
	private JLabel lblNewLabel_3;
	public static JLabel lblNewLabel_4;//倒计时
	public static JLabel lblNewLabel_5;//倒计时
	/**
	 * Create the panel.
	 */
	public UserPanel2() {
		userPanel=this;
		setBorder(new LineBorder(new Color(0, 0, 0)));
		setBackground(Color.WHITE);
		setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBackground(Color.LIGHT_GRAY);
		FlowLayout flowLayout = (FlowLayout) panel.getLayout();
		flowLayout.setAlignOnBaseline(true);
		panel.setBounds(10, 0, 710, 10);
		add(panel);
		
		textField = new JTextField();
		textField.setEditable(false);
		textField.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 14));
		textField.setHorizontalAlignment(SwingConstants.CENTER);
		textField.setForeground(Color.CYAN);
		textField.setText("在线用户");
		textField.setBackground(Color.LIGHT_GRAY);
		textField.setBounds(10, 14, 190, 25);
		add(textField);
		textField.setColumns(10);
		
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
		scrollPane.setBounds(10, 40, 190, 120);
		add(scrollPane);
		
	    panel_1 = new JPanel();
		scrollPane.setViewportView(panel_1);
		panel_1.setPreferredSize(new Dimension(190,1000));
		panel_1.setLayout(null);
		
		JPanel panel_2 = new JPanel();
		panel_2.setForeground(Color.BLACK);
		panel_2.setBounds(203, 14, 257, 140);
		add(panel_2);
		panel_2.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("New label");
		lblNewLabel.setIcon(new ImageIcon(UserPanel2.class.getResource("/images/maininterface/gl.jpg")));
		lblNewLabel.setBounds(10, 12, 60, 50);
		panel_2.add(lblNewLabel);
		
		textField_1 = new JTextField();
		textField_1.setFont(new Font("Dialog", Font.BOLD, 12));
		textField_1.setForeground(Color.BLUE);
		textField_1.setEditable(false);
		textField_1.setText(" 用户名：");
		textField_1.setBounds(81, 20, 120, 25);
		panel_2.add(textField_1);
		textField_1.setColumns(10);
		
		txtId = new JTextField();
		txtId.setFont(new Font("Dialog", Font.BOLD, 12));
		txtId.setForeground(Color.BLUE);
		txtId.setEditable(false);
		txtId.setText("      I D ：");
		txtId.setColumns(10);
		txtId.setBounds(81, 57, 120, 25);
		panel_2.add(txtId);
		
		textField_2 = new JTextField();
		textField_2.setFont(new Font("Dialog", Font.BOLD, 12));
		textField_2.setForeground(Color.BLUE);
		textField_2.setEditable(false);
		textField_2.setText("   棋色  ：");
		textField_2.setColumns(10);
		textField_2.setBounds(81, 94, 120, 25);
		panel_2.add(textField_2);
		
		lblNewLabel_2 = new JLabel("本地用户");
		lblNewLabel_2.setForeground(Color.BLUE);
		lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel_2.setBounds(10, 66, 60, 22);
		panel_2.add(lblNewLabel_2);
		
		lblNewLabel_4 = new JLabel("30 秒");
		lblNewLabel_4.setFont(new Font("Dialog", Font.BOLD, 12));
		lblNewLabel_4.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel_4.setBounds(10, 95, 60, 30);
		panel_2.add(lblNewLabel_4);
		
		JPanel panel_2_1 = new JPanel();
		panel_2_1.setLayout(null);
		panel_2_1.setBounds(463, 14, 257, 140);
		add(panel_2_1);
		
		JLabel lblNewLabel_1 = new JLabel("New label");
		lblNewLabel_1.setIcon(new ImageIcon(UserPanel2.class.getResource("/images/maininterface/g2.jpg")));
		lblNewLabel_1.setBounds(10, 12, 60, 50);
		panel_2_1.add(lblNewLabel_1);
		
		textField_3 = new JTextField();
		textField_3.setFont(new Font("Dialog", Font.BOLD, 12));
		textField_3.setForeground(Color.RED);
		textField_3.setEditable(false);
		textField_3.setText(" 用户名：");
		textField_3.setColumns(10);
		textField_3.setBounds(81, 20, 120, 25);
		panel_2_1.add(textField_3);
		
		textField_4 = new JTextField();
		textField_4.setFont(new Font("Dialog", Font.BOLD, 12));
		textField_4.setForeground(Color.RED);
		textField_4.setEditable(false);
		textField_4.setText("      I D ：");
		textField_4.setColumns(10);
		textField_4.setBounds(81, 57, 120, 25);
		panel_2_1.add(textField_4);
		
		textField_5 = new JTextField();
		textField_5.setFont(new Font("Dialog", Font.BOLD, 12));
		textField_5.setForeground(Color.RED);
		textField_5.setEditable(false);
		textField_5.setText("   棋色  ：");
		textField_5.setColumns(10);
		textField_5.setBounds(81, 94, 120, 25);
		panel_2_1.add(textField_5);
		
		lblNewLabel_3 = new JLabel("对战用户");
		lblNewLabel_3.setForeground(Color.RED);
		lblNewLabel_3.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel_3.setBounds(10, 66, 60, 22);
		panel_2_1.add(lblNewLabel_3);
		
		lblNewLabel_5 = new JLabel("30 秒");
		lblNewLabel_5.setFont(new Font("Dialog", Font.BOLD, 12));
		lblNewLabel_5.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel_5.setBounds(10, 95, 60, 30);
		panel_2_1.add(lblNewLabel_5);

		this.setVisible(false);
	}
}
